<?php 
/*
 module:		职位分类表
 create_time:	2024-03-11 10:24:10
 author:		
 contact:		
*/

namespace app\api\controller;

use app\api\service\CategoryjobsService;
use app\api\model\Categoryjobs as CategoryjobsModel;
use think\exception\ValidateException;
use think\facade\Db;
use think\facade\Log;

class Categoryjobs extends Common {


	/**
	* @api {get} /Categoryjobs/index 01、首页数据列表
	* @apiGroup Categoryjobs
	* @apiVersion 1.0.0
	* @apiDescription  首页数据列表
	* @apiParam (输入参数：) {int}     		[limit] 每页数据条数（默认20）
	* @apiParam (输入参数：) {int}     		[page] 当前页码
	* @apiParam (输入参数：) {string}		[parentid] parentid 
	* @apiParam (输入参数：) {string}		[categoryname] categoryname 
	* @apiParam (输入参数：) {string}		[category_order] category_order 
	* @apiParam (输入参数：) {string}		[stat_jobs] stat_jobs 
	* @apiParam (输入参数：) {string}		[stat_resume] stat_resume 
	* @apiParam (输入参数：) {string}		[content] content 
	* @apiParam (输入参数：) {string}		[spell] spell 
	* @apiParam (输入参数：) {string}		[relation1] relation1 
	* @apiParam (输入参数：) {string}		[relation1_cn] relation1_cn 
	* @apiParam (输入参数：) {string}		[relation2] relation2 
	* @apiParam (输入参数：) {string}		[relation2_cn] relation2_cn 
	* @apiParam (输入参数：) {string}		[jobs_tpl] jobs_tpl 
	* @apiParam (输入参数：) {string}		[rs_id] 人社的id 

	* @apiParam (失败返回参数：) {object}     	array 返回结果集
	* @apiParam (失败返回参数：) {string}     	array.status 返回错误码 201
	* @apiParam (失败返回参数：) {string}     	array.msg 返回错误消息
	* @apiParam (成功返回参数：) {string}     	array 返回结果集
	* @apiParam (成功返回参数：) {string}     	array.status 返回错误码 200
	* @apiParam (成功返回参数：) {string}     	array.data 返回数据
	* @apiParam (成功返回参数：) {string}     	array.data.list 返回数据列表
	* @apiParam (成功返回参数：) {string}     	array.data.count 返回数据总数
	* @apiSuccessExample {json} 01 成功示例
	* {"status":"200","data":""}
	* @apiErrorExample {json} 02 失败示例
	* {"status":" 201","msg":"查询失败"}
	*/
	function index(){
		$limit  = $this->request->get('limit', 20, 'intval');
		$page   = $this->request->get('page', 1, 'intval');

		$where = [];
		$where['parentid'] = $this->request->get('parentid', '', 'serach_in');
		$where['categoryname'] = $this->request->get('categoryname', '', 'serach_in');
		$where['category_order'] = $this->request->get('category_order', '', 'serach_in');
		$where['stat_jobs'] = $this->request->get('stat_jobs', '', 'serach_in');
		$where['stat_resume'] = $this->request->get('stat_resume', '', 'serach_in');
		$where['content'] = $this->request->get('content', '', 'serach_in');
		$where['spell'] = $this->request->get('spell', '', 'serach_in');
		$where['relation1'] = $this->request->get('relation1', '', 'serach_in');
		$where['relation1_cn'] = $this->request->get('relation1_cn', '', 'serach_in');
		$where['relation2'] = $this->request->get('relation2', '', 'serach_in');
		$where['relation2_cn'] = $this->request->get('relation2_cn', '', 'serach_in');
		$where['jobs_tpl'] = $this->request->get('jobs_tpl', '', 'serach_in');
		$where['rs_id'] = $this->request->get('rs_id', '', 'serach_in');

		$field = '*';
		$orderby = 'id desc';

		$res = CategoryjobsService::indexList(formatWhere($where),$field,$orderby,$limit,$page);
		return $this->ajaxReturn($this->successCode,'返回成功',htmlOutList($res));
	}



}

